package com.sun.controller;


import com.sun.mapper.LineMapper;
import com.sun.pojo.FractionalLine;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collection;

@Controller
public class textController {


    @Autowired
    private LineMapper lineMapper;

    @RequestMapping("/text1")
    @ResponseBody
    public Collection<FractionalLine> select1(){
        Collection<FractionalLine> all = lineMapper.select1();
        System.out.println(all);
        return all;
    }

    @RequestMapping("/text2")
    @ResponseBody
    public Collection<FractionalLine> select2(){
        Collection<FractionalLine> all = lineMapper.select2();
        System.out.println(all);
        return all;
    }
    @RequestMapping("/text3")
    @ResponseBody
    public Collection<FractionalLine> select3(){
        Collection<FractionalLine> all = lineMapper.select3();
        System.out.println(all);
        return all;
    }
    @RequestMapping("/w1")
    @ResponseBody
    public Collection<FractionalLine> select11(){
        Collection<FractionalLine> all = lineMapper.select11();
        System.out.println(all);
        return all;
    }

    @RequestMapping("/w2")
    @ResponseBody
    public Collection<FractionalLine> select21(){
        Collection<FractionalLine> all = lineMapper.select21();
        System.out.println(all);
        return all;
    }
    @RequestMapping("/w3")
    @ResponseBody
    public Collection<FractionalLine> select31(){
        Collection<FractionalLine> all = lineMapper.select31();
        System.out.println(all);
        return all;
    }

    @RequestMapping("/line")
    public  String toChinaIndexPage(){
        return "echarts/lineEcharts";
    }


//    @Autowired
//    private NameMapper nameMapper;
//
//
//    @RequestMapping("/emps1")
//    public Object list(Model model) {
//        Collection<SchoolName> all = nameMapper.selectAll();
//        System.out.println(all);
//        model.addAttribute("list", all);
//        return "emp/list1";
////        return all;
//    }
//
//    @RequestMapping("/emps/{pageNo}")
//    public Object page(@PathVariable("pageNo") Integer pageNo, Model model) {
//        Page<SchoolName> page = new Page<>(pageNo, 10);
//        IPage<SchoolName> nameIPage = nameMapper.selectPage(page, null);
//        System.out.println(nameIPage);
//        model.addAttribute("list",nameIPage);
//        return nameIPage;
////        return "emp/list1";
//    }
//    @RequestMapping(value = "/emps1/{pageNo}")
//    public String list(@PathVariable("pageNo") Integer pageNo){
//        Page<name> page = new Page<>(pageNo , 10);
//        IPage<name> nameIPage = nameMapper.selectPage(page,null);
//        System.out.println(nameIPage);
//        return "emp/list1";
//    }
}
